package edu.usx.server.controller;


import edu.usx.server.pojo.Category;
import edu.usx.server.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Usx
 * @since 2024-07-18
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    /**
     * 根据用户id获取分类数据
     * @return
     */
    @GetMapping
    public List<Category> getCategoryByUser(){
        return categoryService.getCategoryByUserId();
    }

}
